3D Graphics Programming with QuickDraw 3D 1.5.4
Previous | QD3D Book | Overview | Chapter Contents | Next |
QuickDraw 3D supports curves and surfaces that can be defined using nonuniform rational B-splines (NURBs), a class of equations defined by nonuniform parametric ratios of B-spline polynomials. A three-dimensional curve represented by a NURB equation is a NURB curve, and a three-dimensional surface represented by a NURB equation is a NURB patch. Figure 7 shows a sample NURB curve.
NURBs can be used to define very complex curves and surfaces, as well as some common geometric objects (for instance, the conic sections). NURB curves and patches are especially useful in 3D imaging because they are invariant under scale, rotate, translation, and perspective transformations of their control points.
A parametric curve is any curve whose points are represented by one or more functions of a single parameter (usually denoted by the letter t or u). The Cartesian coordinates (x, y) of a two-dimensional parametric curve can be represented generally by these two equations:
The Cartesian coordinates (x, y, z) of a three-dimensional parametric curve can be represented generally by these three equations:
For compactness, the two- or three-dimensional point is usually represented as a vector. A two-dimensional point has this vector:
For example, a circle can be defined parametrically by a pair of equations:
Alternatively, a circle can be defined parametrically by this vector equation:
A B-spline polynomial is a parametric equation of this form:
In these equations, the x i are elements of an array of real numbers, known as the knot vector, where each element is greater than or equal to the previous (that is, they are nondecreasing). The B i are, algebraically, the coefficients of the polynomial representing the curve. Geometrically, they are the (x, y) positions (in a two-dimensional curve) of control points, which (together with the knot vector) define the shape of the particular curve of which they are a part. The control points and the knots define the curve's shape in this way: a position of a point on the curve at some parametric value u is a weighted combination of the positions of a subset of all the control points; the "weighting" is determined by the relative values of the knot vector.
Finally, a NURB curve is a curve defined by ratios of B-spline polynomials, where the values assigned to the parameter can be nonuniform. A NURB patch is a surface defined by ratios of B-spline surfaces, which are three-dimensional analogs of B-spline curves. A B-spline surface is a surface defined by a parametric equation of this form:
In these equations, the factors B i , j are, algebraically, the coefficients of the polynomial representing the surface. Geometrically, they are the (x, y, z) coordinates of the control points that define the surface. The factors w i , j are the weights of those control points. The factors x i and y j are elements of arrays of real numbers, again called knot vectors. These vectors must be non-decreasing.
Previous | QD3D Book | Overview | Chapter Contents | Next |